package com.youpai.platform.order.service.mapper;

import com.youpai.platform.order.service.entity.po.OrderEvaluatePO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @time: 2022/11/27
 * @author: huanghao
 * @description: 订单mapper
 */
@Repository
public interface OrderEvaluateMapper {

    //新增评价
    Integer add(OrderEvaluatePO orderEvaluatePO);

    //更新评价
    Integer update(OrderEvaluatePO orderEvaluatePO);

    //通过ID获取订单评价信息
    OrderEvaluatePO get(Long evaluateId,Long orderId);

    //通过订单ID获取订单评价信息列表
    List<OrderEvaluatePO> getEvaluateList(
            @Param(value = "orderIds") List<Long> orderIds);


    //获取评价列表
    List<OrderEvaluatePO> getByOrderId(
            @Param(value = "orderId") Long orderId,
            @Param(value = "offset") Integer offset,
            @Param(value = "length") Integer length);

    //数据条数
    Integer countItem(
            @Param(value = "orderId") Long orderId);

    //删除评价列表
    Integer remove(
            @Param(value = "evaluateIds") List<Long> evaluateIds);

}
